<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="app">
        <div
            @click="handleDivClick"
            :style="[styleObj, {fontSize: '20px'}]"
        >
            hello world
        </div>
    </div>
    <script>
        var vm = new Vue({
            el:"#app",
            data: {
                styleObj: {
                    color: "black"
                }
            },
            methods: {
                handleDivClick: function () {
                    this.styleObj.color = this.styleObj.color === "black" ? "red" : "black";
                }
            }
        })
    </script>
</body>
</html>